/*
 * test_framework_meory_placement_new_pool.h
 *
 *  Created on: 2014. 6. 23.
 *      Author: jjaehuny
 */

#ifndef TEST_FRAMEWORK_MEORY_PLACEMENT_NEW_POOL_H_
#define TEST_FRAMEWORK_MEORY_PLACEMENT_NEW_POOL_H_

#include <memory>

#include <gtest/gtest.h>
#include <glog/logging.h>

#include <Framework/Memory/Placement_new_Pool.h>

class test_framework_memory_placement_new_pool : public testing::Test
{
public:
	class Dummy
	{
	public:
		Dummy() { LOG(INFO) << __PRETTY_FUNCTION__; }
		~Dummy() { LOG(INFO) << __PRETTY_FUNCTION__; }
	};

public:
	::Framework::Memory::Placement_new_Pool<Dummy> clsPool;

	// Sets up the test fixture.
	virtual void SetUp() {
		clsPool.Post(new Dummy);
	}

	// Tears down the test fixture.
	virtual void TearDown() {}
};

TEST_F(test_framework_memory_placement_new_pool, test_framework_memory_placement_new_pool)
{
	{
		std::shared_ptr<Dummy> obj = clsPool.NEW();
		EXPECT_TRUE (NULL != obj.get());
	}

	{
		std::shared_ptr<Dummy> obj = clsPool.NEW();
		EXPECT_TRUE (NULL != obj.get());
	}
}




#endif /* TEST_FRAMEWORK_MEORY_PLACEMENT_NEW_POOL_H_ */
